import 'package:get/get.dart';
import 'package:lishopflu/global/my_theme_data.dart';
import 'package:lishopflu/global/theme_colors.dart';
import 'package:lishopflu/page/splash/splash_ctr.dart';
import 'package:lishopflu/utils/sp_key.dart';
//import 'package:provider/provider.dart';
import '../../base/view_import.dart';

/*
  执行顺序：SplashCtl.onFirst -> SplashPage.onCreate
 */
class SplashPage extends BasePage<SplashCtl>{


  @override
  void onCreate(BuildContext mContext) {
    setAppTitle('Splash');
    SPKey.spGetStr(SPKey.themeIndex).then((onValue){
//      Provider.of<ThemeProvide>(mContext, listen: false).setTheme(onValue);
      Get.changeTheme(MyThemeData.appTheme(THColors.themeColor[onValue]));
    });
  }

  @override
  Widget pageBody(BuildContext context) {
    return Container(
//      width: double.infinity,
//      height: double.infinity,
      alignment: Alignment.center,
      color: Color.fromRGBO(0, 0, 0, 0),
      child: Icon(Icons.add_shopping_cart),
    );
  }

  Widget appbar(){
    return null;
  }
}